import request from '@/utils/request.js'

// 列表
export const roleList = (params) => {
    return request({
        url: '/sys/role/list',
        method: 'get',
        params: params
    })
}

// 机构树形列表
export const agencySelectList = () => {
    return request({
        url: '/agency/select',
        method: 'get'
    })
}

// 添加角色
export const addRole = (data) => {
    return request({
        url: '/sys/role/save',
        method: 'post',
        data: data
    })
}

// 删除角色
export const  delRole = (data) => {
    return request({
        url: '/sys/role/delete',
        method: 'post',
        data: data
    })
}

// 用户详情
export const roleDetail = (id) => {
    return request({
        url: '/sys/role/info/' + id,
        method: 'get',
    })
}

// 菜单列表
export const menuList = () => {
    return request({
        url: '/sys/menu/list',
        method: 'get',
    })
}

// 编辑角色
export const editRole = (data) => {
    return request({
        url: '/sys/role/update',
        method: 'post',
        data: data
    })
}
